/* 
 * File:   mover1d.h
 * Author: oddi
 *
 * Created on October 3, 2010, 1:31 PM
 */

#ifndef _MOVER1D_H
#define	_MOVER1D_H

#include "global_definitions.h"
#include "ucgrid1d.h"
#include "ebsources.h"

#define MAX_BUF_SIZE 256

//this API allows to move only 1d systems
//it is supposed there are only Ex and Bz fields in the system
//z is the only dimension of the system
//particles have vz and v_perp speed
//now it works only with one sort of particles


#ifdef	__cplusplus
extern "C" {
#endif

    typedef struct struct_mover1d_parameters {
        ucgrid1d* grid;
        particles_set* set;
        sources_pack* sources;
        floatdig dt;
    } mover1d_parameters;

    typedef struct struct_mover1d_initialized {
        sources_pack* sources;
        floatdig* E_ext;
        floatdig* B_ext;
        int cycles;
        floatdig qm;
        floatdig qmc;
        floatdig dt;
        floatdig dx;
    } mover1d;

    typedef mover1d* pmover;

    int mover1d_setup_mover(mover1d_parameters*, mover1d*);
    void mover1d_single_iteration(mover1d* mover, ucgrid1d* grid, particles_set* set);
    void mover1d_clear_mover(mover1d* mover);

    #ifdef DEBUG
    void mover1d_make_snapshot_of_ext_E(ucgrid1d*, mover1d*, char*);
    #endif

#ifdef	__cplusplus
}
#endif

#endif	/* _MOVER1D_H */

